#!/usr/bin/env python
# -*— coding: utf-8 -*-
import threading

# 字典方式  以当前线程名为键

local_school = threading.local()

def processStudent():
  std = local_school.student
  print('Hello, %s (in %s)'%(std, threading.current_thread().name))


def processThread(name):
  local_school.student = name
  processStudent()


t1 = threading.Thread(target=processThread, args=('dongGe',), name='Thread-A')
t2 = threading.Thread(target=processThread, args=('老王',), name='Thread-B')

t1.start()
t2.start()
t1.join()
t2.join()